NeXT TypedStream Data | 1992-01-22 | 23KB | 464 lines
typedstream
StreamTable
HashTable
Object
[20c]
typedstream
[1738c]
typedstream
HashTable
Object
WaterfallComputer
HeaderClass
%%%%i@@
genericobject_nib
mySignalProcessor
myApp
Spectro
Application
/usr/include/sys/message.h
appnib
windowTime
totalSeconds
loopButton
windowType
numFrames
myWaterfallView
soundMeter
myView
freqRange
windowSize
mySound
viewLimit
stopButton
fileName
wfTimes
zpFactor
myWaterfallComputer
soundView
goOnSelect
hopTime
currentPlot
freqRange2
frameSlider
currentTime
beginTime
play:
changeTimeSetups:
willPlay:
didPlay:
knockItOff:
didRecord:
running:
changeZPFactor:
zoomIn:
calculate:
changeViewLimit:
willRecord:
showAll:
frameChange:
sliderChange:
timeChange:
setup:
selectionChanged:
record:
load:
stop:
changeFreqMax:
changeWindowSize:
save:
showSelection:
zoomOut:
SignalProcessor
ScrollingSound
viewnib
FirstResponder
firstnib
checkSpelling:
alignSelCenter:
unscript:
pasteFont:
runPageLayout:
superscript:
copyRuler:
copyFont:
selectAll:
pasteRuler:
toggleRuler:
showGuessPanel:
alignSelLeft:
paste:
performClose:
arrangeInFront:
subscript:
copy:
alignSelRight:
delete:
orderFrontColorPanel:
underline:
performMiniaturize:
SpectrumView
freqField
ampField
printMyPSCode:
WaterfallView
plotHeight
myMax
myMin
[21067c]
typedstream
HashTable
Object
Bitmap
Spectro
iii00
[576c]
NibData
@@@@s
Storage
{*@@}
[120{*@@}]
File's Owner
CustomObject
InfoPanel
WindowTemplate
ffffZ
iiii***@s@
Panel
Responder
TextField
Control
TextFieldCell
ActionCell
Helvetica
Version 2.497
Jan., 1992
by Perry R. Cook
Button
ButtonCell
=Stanford Center for Computer
Research in Music and Acoustics
A Spectrum Analysis Tool
Button1
Field1
Field2
VersionNumber
Field
Field3
MainMenu
MenuTemplate
*@*@ccc
Matrix
@:@iiii
[11@]
MenuCell
Info...
Paste
Select All
ff@@#::s
submenuAction:
menuArrow
Spectrum
Capture
Waterfall
PrintWF
PrintSP
MenuItem1
'Real Time (so called) Spectrum Analyzer
Window
0 Hz.
1000 Hz.
2000 Hz.
3000 Hz.
4000 Hz.
-15 dB
-30 dB
-45 dB
-60 dB
FormCell
Freq. of Cursor Position:
Field:
Ampl. of Cursor Position:
FreqRange
Helvetica-Bold
Hanning
Window Type:
Window Size:
Zero Pad Factor (>=1):
N(Options: Rectangular,Triangular,Hamming,
Hanning,Blackman3,Blackman4,Kaiser)
0.03195
Window Time:
0.01598
HopTime:
Selection Time:
Selection Begin:
Number of Frames to Process:
2These are your controls over the spectrum analysis
dBRangeS
Sine Error at Cursor:
CustomView
SpectrumView
Title
Stop!
Field4(
Matrix1,
Form6:
Freq. of Cursor Position<:
Ampl. of Cursor PositionGF
Form3cU
Window Sizedc
Form4mU
Zero Pad Factor (>=1)nm
Form2YU
Window TypeZY
Window Time}|
HopTime
Form5
Selection Time
Form7
Selection Begin
Form1
Number of Frames to Process
Sine Error at Cursor
Matrix2
SignalProcessor
'Waterfall Plot (Active if # Frames > 1)
[10@]
Slider
SliderCell
Current Cursor Time:
Current Plot #:
Select Plot--^
Individual Plot Height (>1):
WaterfallView
0.000
MinTimeS
MaxTimeS
Slider1
Current Cursor Time
Current Plot #
Individual Plot Height (>1)
Spectro Help
ScrollView
ClipView
ciifffcfffs
[8380c]{\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;}
\margl40
\margr40
{\colortbl\red0\green0\blue0;}
\f0\b\i0\ul0\ql\fs36\fi0\li0\gray0\up0\dn0 Spectro Help
\b0 \
\fs24 \
Welcome to Spectro, a spectrum analysis application for the NeXT. Direct bugs/suggestions in large groups (save up a few before you mail) to Perry R. Cook prc@ccrma.stanford.edu. The program performs frequency transforms on sound data and displays the resultant spectrum. This is similar to passing light through a prism, which splits it into its component colors. To really use and understand all of the features of this program, you should take Julius Smith's sequence in digital signal processing for music offered at CCRMA. Optionally, you might read Xavier Serra's PhD. dissertation available from CCRMA. \
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\fc0 The
\b Soundfile Capture Window
\b0 controls a single sound. You can record into the sound from the CODEC port by pressing the
\b Record
\b0 button. Recording is indicated by the sound meter above the sound view, and can be stopped by pressing the
\b Stop
\b0 button. After recording, the view shows the new sound. You can play the file by pressing
\b Play
\b0 , and the playing process can be aborted by pressing
\b Stop
\b0 .\
You can load a previously generated sound file by typing the file name (with complete file path) into the
\b FileName:
\b0 field, and pressing the
\b Load
\b0 button or hitting carriage return in the
\b FileName:
\b0 field.
\b Save
\b0 saves the current sound to the file specified in
\b FileName:
\b0 . It is important to remember that the soundfile specified by
\b FileName:
\b0 is not necessarily the current sound. The current sound can be modified by recording, editing, or by loading from a file. If the current sound is modified by recording or editing, it will not match the file from which it was loaded.\
The sound can be viewed in the sound view. If the sound is larger than the view, a scroll slider appears at the bottom of the view, and you can use it to scan across the sound. Pressing the
\b All
\b0 button causes the view to display the entire sound.
\b ZoomIn
\b0 and
\b ZoomOut
\b0 zooms the display, and
\b Select
\b0 zooms the display to the selected piece of the sound (see below).\
By dragging over the sound in the window, a piece of the sound is selected and is displayed in grey. The entire sound can be selected by using the
\b Select All
\b0 command under
\b Edit
\b0 in the main menu. The selected portion can be copied or cut using the commands under
\b Edit
\b0 in the main menu, or by using the <command> key arguments. Once a piece is cut or copied, it can be pasted to any area within the sound, or even to another sound window. The sound segment is pasted wherever the cursor is located, and if a selection is made, the selection is replaced by the segment which is in the cut/copy buffer.\
An important recommended operation is to remove any silence at the beginning and end. This makes signal processing easier later. Once you are happy with your captured sound, you can perform spectrum analysis on it.\
\pard The defaults get you reasonable speech spectrum analysis at the CODEX rate of 8012 Hz.\
\b Window Size
\b0 determines how much data is processed.
\b Window Time
\b0 tells you how long this is in seconds.
\b Zero Padding Factor
\b0 is a multiplier on the
\b Window Size
\b0 which determines the size of the transform. Frequency transforms in this program are restricted (for now) to powers of four, so if you pick a
\b Window Size
\b0 of 257, the
\b Zero Padding Factor
\b0 is automatically set to 3.984436 to yield a transform size of 1024. You can explicitly set the
\b Zero Padding Factor
\b0 to something greater than one for reasons which I will not explain here.
\b # Frames
\b0 is a positive integer which determines how many windows of data are processed. If
\b # Frames
\b0 is greater than one, the window is `hopped' through the signal so that adjacent windows overlap by a factor of two. The
\b Hop Time
\b0 field tells you the time between adjacent analysis windows.
\b Total Time
\b0 tells you the length of the entire event that you can process.
\b Window Type
\b0 selects the window used for smoothing the data. I will discuss this no more except to say that if you want to see the effects of different windows, try a simple whistle at one frequency and process it with different windows.\
Dragging over a section of the sound in the SoundView causes many of the fields to update. This is the spectrum analyzer calculating and displaying the time of the section that will be analyzed.
\b GO!
\b0 causes the region selected in the SoundView to be transformed to the frequency domain and displayed. If you select
\b Go On Select
\b0 in the
\b SoundFile Capture
\b0 window, the spectrum analyzer will recalculate and display the spectra each time you make a new selection in the sound view. The
\b Stop!
\b0 button stops the processing.\
\b # Frames
\b0 is one or less (if you select a very small amount of the sound view), the frequency domain data is displayed in one frame in the
\b Real Time Spectrum Analyzer
\b0 window. Typing a negative number into the
\b dBRange
\b0 field changes the scale of the display. The plots are always referenced to 0 dB = maximum a sound can be, so by typing in the floor as a negative number, you set the range. Pointing to the display causes a cursor to appear and follow the mouse. This cursor causes the
\b\fc0 Frequency of Cursor Position
\b0 and
\b Amplitude of Cursor Position
\b0 fields to display the frequency and amplitude of the spectrum at the cursor location.
\b Sinusoidal `Error' at cursor
\b0 does nothing at the moment, but holds great promise for helping you interpret peaks in the spectrum in the future.\
\b0 is greater than one, the data is displayed in the
\b Waterfall Plot
\b0 view, with increasing time running upward. Don't be confused by the display, the plots are drawn from top to bottom, which is actually reverse time (it's easier to do hidden line removal this way, not your problem, mine). The slider at the right of the
\b Waterfall Plot
\b0 window allows you to select an individual spectrum for display in the
\pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\b Real Time Spectrum Analyzer
\b0 window
\pard . The time corresponding to the selected spectrum is printed in the
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\b\fc0 Current Time of Slider/Cursor
\pard\b0\fc0 field. Changing the
\b FreqRange
\b0 of the
\b Real Time Spectrum Analyzer
\b0 view causes the
\b Waterfall Plot
\b0 to redraw all spectra.
\b Individual Plot Height
\b0 causes the individual plots in the waterfall view to be drawn scaled by that amount. If
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\b\fs36 Coming in the Future\
\fs32 \
\b0\fs24 1. Less bugs\
2. More features, so new bugs\
3. Real time spectrum analysis (Run mode).\
4. DSP port mic support (I hope to support CODEX, 44.1 and 22.05 KHz mono or stereo for processing, and make the DSP do the conversion on the fly, summing both channels and doing sampling rate conversion to yield the 22.05 kHz file).\
5. Help in interpreting features in the spectrum.\